{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<div class="page-container">
    <form  method="get" action="">

    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            累计<span style="color: red">{$header['t_money']}</span> : 今日<span style="color: red">{$header['d_money']}</span>
        </span>

        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="12">收款列表</th>
        </tr>
        <tr class="text-c">
            <th width="70">标识</th>
            <th width="80">用户名</th>
            <th width="80">手机</th>
            <th width="150">账号/卡号</th>
            <th width="150">账号信息</th>
            <th width="80">累计金额</th>
            <th width="80">单日累计</th>
            <th width="80">卡号类型</th>
            <th width="80">用户类型</th>
            <th width="80">备注</th>
            <th width="80">冻结</th>
            <th width="50">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $v}
        <tr class="text-c">
            <td class="text-l">
                {$v.id}
            </td>
            <td class="text-l">
                {$v.user_name}
            </td>
            <td class="text-l">
                {$v.mobile}
            </td>
            <td class="text-l">
                {$v.account}
            </td>
            <td class="text-l">
                开户行： {$v.bank_name}<br>支行行： {$v.bank_brach_name}
            </td>
            <td class="text-l">
                {$v.t_money}
            </td>
            <td class="text-l">
                {$v.d_money}
            </td>
            <td class="text-l">
                {switch name="$v.type"}
                {case value="1"}支付宝{/case}
                {case value="2"}微信{/case}
                {case value="3"}银行卡{/case}
                {case value="4"}平台收款{/case}
                {default /}--
                {/switch}
            </td>
            <td class="text-l">
                {if $v.uid == 0}
                系统
                {else/}
                用户
                {/if}
            </td>
            <td class="text-l">
                {$v.mark}
            </td>
            <td>
                {if $v.status == 1}
                <span class="label label-success radius" onclick="bankstatus(this,{$v.id},{$v.status})">
                        已启用</span>
                {else/}
                <span class="label label-danger radius" onclick="bankstatus(this,{$v.id},{$v.status})">
                        禁用中</span>
                {/if}
            </td>
            <td>
                <a class="btn btn-default radius" title="个人信息" href="javascript:;" onclick="layopen('文章编辑','{:url('bankedit',['id'=>$v.id])}',900,650)"><i class="Hui-iconfont">&#xe6df;</i></a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
    function bankstatus(obj,id,status){
        if(status == 1){
            var info = '确认要禁用吗？';
        }else{
            var info = '确认要启用吗？';
        }
        layer.confirm(info,function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('bankstatus')}",
                data: {id:id,status:status},
                dataType: 'json',
                success: function(data){
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            location.replace(location.href);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }

</script>